﻿using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fluent.Light.Elements
{
    public class CheckBox : WebElement
    {
        public CheckBox(IWebDriver driver, By by)
            : base(driver, by) { }

        public static void Check(IWebElement element)
        {
            if (!element.Selected)
            {
                element.Click();
            }
        }

        public static void UnCheck(IWebElement element)
        {
            if (element.Selected)
            {
                element.Click();
            }
        }

        public virtual void Check()
        {
            Check(this);
        }

        public virtual void UnCheck()
        {
            UnCheck(this);
        }
    }
}